package com.gears_software.bbnetwork.activitys;

import java.util.ArrayList;
import java.util.List;

import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.ViewById;
import org.androidannotations.annotations.WindowFeature;
import org.androidannotations.annotations.sharedpreferences.Pref;

import android.app.Activity;
import android.content.Intent;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.ImageView;

import com.avos.avoscloud.AVAnalytics;
import com.gears_software.bbnetwork.R;
import com.gears_software.bbnetwork.adapters.GuideAdapter;
import com.gears_software.bbnetwork.utlis.BBNetworkSharedPref_;

@EActivity(R.layout.activity_guide)
@WindowFeature(Window.FEATURE_NO_TITLE)
public class GuideActivity extends Activity {
	
	@ViewById
	ViewPager viewpager_guide;
	
	@Pref
	BBNetworkSharedPref_ sp;
	
	GuideAdapter adapter;
	@AfterViews
	void onCreate(){
		LayoutInflater layout = LayoutInflater.from(this);
		List<View> list = new ArrayList<View>();
		list.add(layout.inflate(R.layout.guide_ydy1_item, null));
		list.add(layout.inflate(R.layout.guide_ydy2_item, null));
		list.add(layout.inflate(R.layout.guide_ydy3_item, null));
		View view = layout.inflate(R.layout.guide_ydy4_item, null);
		ImageView startImage = (ImageView) view.findViewById(R.id.startImage);
		startImage.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View arg0) {
				sp.cound().put("2");
				Intent i = new Intent(GuideActivity.this,LoginActivity_.class);
				startActivity(i);
				finish();
			}
		});
		list.add(view);
		adapter = new GuideAdapter(list,this);
		viewpager_guide.setAdapter(adapter);
	}
	
	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		super.onResume();
		 AVAnalytics.onResume(this);
	}
	
	@Override
	protected void onPause() {
		// TODO Auto-generated method stub
		super.onPause();
		AVAnalytics.onPause(this);
	}
}
